#include "customervieweditdialog.h"
#include <QDebug>

void CustomerViewEditDialog::setCustomer(CustomerModel *customer)
{
    this->nameEdit->setText(customer->getName());
    this->addressEdit->setText(customer->getAddress());
    this->contactEdit->setText(customer->getContactNumber());
    this->noteEdit->setText(customer->getNote());
    this->customer = customer;
}

CustomerViewEditDialog::CustomerViewEditDialog(QWidget *parent, CustomerModel *customer) :
    CustomerViewAddDialog(parent)
{
    qDebug() << "CustomerViewEditDialog: Got customer with ID " << customer->getID();
    this->setWindowTitle("Edit Customer Details");
    this->headerLabel->setText("Edit a Customer's Details");
    this->instructionLabel->setText("Edit your Customer's details as needed.");
    this->setCustomer(customer);
}
